//
//  ContributionLogic.m
//  UniversalApp
//
//  Created by 志刚杨 on 2018/3/26.
//  Copyright © 2018年 voidcat. All rights reserved.
//

#import "ContributionLogic.h"
#import "OrderModel.h"

@implementation ContributionLogic
- (instancetype)init
{
    self = [super init];
    if (self) {
        _page = 1;
        _dataArray = [NSMutableArray array];
    }
    return self;
}


-(void)loadData
{
    
    NSString *url = [[CYURLUtils sharedCYURLUtils] makeURLWithC:@"rank_api" A:@"user_contribution_rank"];
    
    NSMutableDictionary *param = [NSMutableDictionary dictionary];
    [param setObject:SafeStr(self.touid) forKey:@"to_user_id"];
    [CYNET POSTv2:url parameters:param responseCache:^(id responseObject) {
        
    } success:^(id responseObject) {
        
        _dataArray = [NSMutableArray modelArrayWithClass:[OrderModel class] json:[responseObject valueForKey:@"list"]];
        if (self.delegagte && [self.delegagte respondsToSelector:@selector(requestDataCompleted)]) {
            [self.delegagte requestDataCompleted];
        }
    } failure:^(NSString *error) {
       
    } hasCache:YES];
}


@end
